#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
bool check(int n,int h,int t,ll mid)
{
	ll cnt = 0;
	cnt += mid / h * t;
	if (t >= h)
	{
		cnt += mid % h;
	}
	return cnt >= n;
}
void lib()
{
	int n, h, t;
	cin >> n >> h >> t;
	ll l = 0, r = 2e14;
	while (l+1 < r)
	{
		ll mid = (l + r) >> 1;
		if (check(n, h, t, mid))
			r = mid;
		else
			l = mid;
	}
	cout << r << endl;
}
int main()
{
	int T;
	cin >> T;
	while (T--)
	{
		lib();
	}
	return 0;
}